package cn.ml.web1662.service;


import cn.ml.web1662.dao.StudentDao;
import cn.ml.web1662.dao.StudentDaoImpl;
import cn.ml.web1662.entity.Pagination;
import cn.ml.web1662.entity.Student;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    private StudentDao dao = new StudentDaoImpl();
    public Student get(String idStr) {
        int  id = Integer.parseInt(idStr);
        Student student=dao.get(id);
        return student;
    }

    @Override
    public void update(Student student) {
        dao.update(student);
    }

    @Override
    public void save(Student student) {
        dao.save(student);
    }

    @Override
    public List<Student> list() {
        return dao.list();
    }

    @Override
    public void delete(int id) {
        dao.delete(id);
    }

    @Override
    public void listByPagination(Pagination<Student> pagination) {
        dao.listByPagination(pagination);
    }

    @Override
    public boolean findByName(String name) {
        return dao.findByName(name);
    }
}
